package com.huike.service;

import com.huike.mapper.CheckChargeMapper;
import com.huike.pojo.Charge;
import com.huike.pojo.Register;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CheckChargeService {

    @Autowired
    private CheckChargeMapper checkChargeMapper;

    public List<Register> getRegister(String registerName, String id){
       return checkChargeMapper.getRegister(registerName,id);
    }

    public Register getByidRegister(Integer id){
        return checkChargeMapper.getByidRegister(id);
    }

    public List<Charge> infoRefisterCharge(Integer hospitalId){
       return checkChargeMapper.infoRefisterCharge(hospitalId);
    }

    public Integer delChargeHospital(Integer id){
        return checkChargeMapper.delChargeHospital(id);
    }

    public Integer addCharge(Integer chargeId,Integer id){
        checkChargeMapper.updateEndStatus(id);
        return checkChargeMapper.addCharge(chargeId,id);
    }

    public void updateChargeDate(Integer id, String chargeDate) {
        checkChargeMapper.updateChargeDate(id,chargeDate);
    }
}
